import React, { useState } from 'react';
import styles from '@/pages/SalaryManage/components/SuperSearch/index.less';
import { Form } from 'antd';
import classNames from 'classnames';
import SuperSearchContext from './context';

const Wrapper = ({ style, className, children, onSearch }) => {
    const [collapsed, setCollapsed] = useState(true);
    const context = { collapsed, setCollapsed, onSearch };

    return (
        <SuperSearchContext.Provider value={context}>
            <div style={style} className={classNames(className, styles.SuperSearch)}>
                <Form layout="inline">{children}</Form>
            </div>
        </SuperSearchContext.Provider>
    );
};

Wrapper.defaultProps = {
    className: null,
    style: null
};

Wrapper.displayName = 'SuperSearch.Wrapper';

export default Wrapper;
